<!--引入头部文件-->
<include file="./Public/Admin/Index/top.html" />

<!--左侧导航-->
<include file="./Public/Admin/Index/left.html" />

    <!--/sidebar-->
    <div class="main-wrap">
        <div class="crumb-wrap">
            <div class="crumb-list"><i class="icon-font"></i><a href="/jscss/admin/design/">首页</a><span class="crumb-step">&gt;</span><a class="crumb-name" href="/jscss/admin/design/">标签管理</a><span class="crumb-step">&gt;</span><span>标签列表</span></div>
        </div>
        <div class="search-wrap">
            <div class="search-content">
                <form action="#" method="get" enctype="multipart/form-data">
                    <table class="search-tab">
                        <tr>
                            <th width="70">标签:</th>
                            <td><input class="common-text" placeholder="关键字" name="keywords" value="{$keywords}" type="text" ></td>
                            <td><input class="btn btn-primary btn2" name="sub" value="查询" type="submit"></td>
                        </tr>
                    </table>
                </form>
            </div>
        </div>
        <div class="result-wrap">
            <form name="myform" id="myform" method="post">
                <div class="result-title">
                    <div class="result-list">
                        <a href="{:U('Tag/tag')}"><i class="icon-font"></i>新增标签</a>
                        <a id="batchDel" href="javascript:void(0)"><i class="icon-font"></i>批量删除</a>
                        <a id="updateOrd" href="javascript:void(0)"><i class="icon-font"></i>更新排序</a>
                        <a href="javascript:void(0)" onclick="clickAll()">╋全选</a>
                        <a href="javascript:void(0)" onclick="notAll()">╬反选</a>
                    </div>
                </div>
                <div class="result-content">
                    <table class="result-tab" width="100%">
                        <tr>
                            <th class="tc" width="5%"><input class="allChoose" id="" name="" type="checkbox" onclick="all()"></th>
                            <th id="AAA">ID</th>
                            <th id="AAA">标签</th>
                            <th id="AAA">操作</th>
                        </tr>
                        <volist name="list" id="val">
                        <tr>
                            <td class="tc"><input type="checkbox" name="clickBox" value="{$val.tid}"></td>
                            <td class="tc">{$val.cid}</td>
                            <td class="tc">{$val.tname}</td>
                            <td>
                                <a class="link-update" href="#">修改</a>
                                <a class="link-del" href="{:U('Tag/delete',array('cid'=>$val['cid']))}" onclick='if(!confirm("确认删除么?")){return false;}'>删除</a>
                            </td>
                        </tr>
                        </volist>
                    </table>
                    <div class="list-page">{$page}</div>
                </div>
            </form>
        </div>
    </div>
    <!--/main-->
</div>
</body>
</html>
<script>
    //    //全选反选
    //    $("input[name='all']").click(function(){
    //        $("input[name='all2']").prop("checked",$("input[name='all']").prop("checkde"));
    //    })

    //全选
    function clickAll() {
        var checkBox = document.getElementsByName('clickBox');
        if (checkBox[0].checked==true){
            for (i=0;i<checkBox.length;i++){
                checkBox[i].checked=false;
            }
            return;
        }
        for (i=0;i<checkBox.length;i++){
            checkBox[i].checked='checkde';
        }
    }

    //反选
    function notAll() {
        var checkBox = document.getElementsByName('clickBox');
        for (i=0; i<checkBox.length;i++) {
            if (checkBox[i].checked== true) {
                checkBox[i].checked = false;
            }else{
                checkBox[i].checked = 'checkde';
            }
        }
    }

</script>